package pers.xx.sbm.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import pers.xx.sbm.entity.User;
import pers.xx.sbm.service.LoginService;
import pers.xx.sbm.vo.ResResult;

/**
 * @author ：xiexing
 * @description：登录Controller
 * @date ：2020/9/24 11:04
 */
@Controller
public class LoginController {
    @Autowired
    LoginService loginService;

    /**
     * @param user 用户名和密码接受类
     * @description 登录接口
     * @author XieXing
     * @date 2020/9/24 11:07
     */
    @RequestMapping(value = "/login", method = RequestMethod.POST)
    @ResponseBody
    public ResResult<Object> login(User user, String code) {
        return loginService.login(user, code);
    }



}
